package com.huawei.appmarket.service.externalapi.jumpers;

import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.huawei.appmarket.service.distribution.deeplink.fulldetail.DisFullDetailActivityProtocol;
import com.huawei.appmarket.service.distribution.deeplink.fulldetail.DisFullDetailActivityProtocol.Request;
import com.huawei.hms.framework.common.ContainerUtils;
import o.ceb;
import o.cjm;
import o.cjo;
import o.Logger;
import o.dof;
import o.drj;
import o.dxk;
import o.dyo;
import o.dyr;
import o.dys.a;
import o.dyw;

public class HiAppLinkActionJumper extends dyw {
    public HiAppLinkActionJumper(dyr o_dyr, a aVar, Uri uri) {
        super(o_dyr, aVar, uri);
    }

    public void ॱ() {
        Object ˏ = ceb.ˏ(this.ˊ, "detailType");
        if (TextUtils.isEmpty(ˏ)) {
            ˋ();
        } else {
            ॱ(ˏ);
        }
    }

    private void ˋ() {
        String ˏ = ceb.ˏ(this.ˊ, "accessID");
        String ˏ2 = ceb.ˏ(this.ˊ, "appId");
        Object ˏ3 = ceb.ˏ(this.ˊ, "extraParam");
        String ˏ4 = ceb.ˏ(this.ˊ, "initParam");
        String ˏ5 = ceb.ˏ(this.ˊ, "referrer");
        cjo disFullDetailActivityProtocol = new DisFullDetailActivityProtocol();
        Request request = new Request();
        request.ˋ(drj.ˏ(ˏ2));
        request.ˎ(true);
        if (!TextUtils.isEmpty(ˏ)) {
            request.ʽ(ˏ);
        }
        if (!TextUtils.isEmpty(ˏ3)) {
            request.ˊॱ(ˏ3);
        }
        if (!TextUtils.isEmpty(ˏ4)) {
            request.ˋॱ(ˏ4);
            if (!dof.ˋ(ˏ2)) {
                dyo.ˏ(ˏ2, ˏ4);
            }
        }
        if (!TextUtils.isEmpty(ˏ5)) {
            request.ॱˊ(ˎ(ˏ5));
        }
        request.ॱˋ(ˏ2);
        disFullDetailActivityProtocol.ˋ(request);
        this.ˏ.ˎ(new cjm("distribution.fulldetail.activity", disFullDetailActivityProtocol), 0);
        this.ˎ.dailyReport(ˏ, ˏ5);
        this.ˏ.finish();
    }

    private void ॱ(@NonNull String str) {
        String ˏ = ceb.ˏ(this.ˊ, "appId");
        if ("1".equals(str)) {
            this.ˏ.ˎ(dxk.ॱ(this.ˊ, ˏ, str), 0);
            this.ˏ.finish();
        } else if ("0".equals(str)) {
            this.ˏ.ˎ(dxk.ˋ(this.ˊ, ˏ, str), 0);
            this.ˏ.finish();
        } else {
            Logger.e("HiAppLinkActionJumper", "error distribution detailType");
            ˊ();
        }
        ˎ();
    }

    private void ˎ() {
        this.ˎ.dailyReport(ceb.ˏ(this.ˊ, "accessID"), ceb.ˏ(this.ˊ, "referrer"));
    }

    private String ˎ(String str) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("referrer").append(ContainerUtils.KEY_VALUE_DELIMITER).append(dof.ˎ(str)).append(ContainerUtils.FIELD_DELIMITER).append("clickTime").append(ContainerUtils.KEY_VALUE_DELIMITER).append(System.currentTimeMillis());
        return stringBuilder.toString();
    }
}
